package com.wondersgroup.framework.widget.library.extjs.form;

import com.wondersgroup.framework.widget.codegen.CodeGenerator;
import com.wondersgroup.framework.widget.codegen.annotation.ObjectField;
import com.wondersgroup.framework.widget.codegen.annotation.ObjectMapping;
import com.wondersgroup.framework.widget.codegen.process.BaseCodeObject;
import com.wondersgroup.framework.widget.codegen.process.CodeObject;

@ObjectMapping("Ext.ux.form.DateTime")
public class ExtDateTimeField extends ExtBaseDateField {

	@ObjectField(index = 1)
	private String dateFormat = "Y-m-d";

	@ObjectField(index = 2)
	private String timeFormat = "H:i:s";

	@ObjectField(index = 3)
	private String dateWidth = "140";

	@ObjectField(index = 4)
	private String timeWidth = "100";

	@ObjectField(index = 5, token = true)
	private String timeConfig = "{altFormats : 'H:i:s',twentyFour : true}";

	@ObjectField(index = 6, token = true)
	private String dateConfig = "{altFormats :'m/d/Y|m-d-y|m-d-Y|m/d|m-d|d|Ymd|Ym|ymd|Y-m-d'}";

	public String getJS() {
		this.defaultCodeObject.setContext(this);
		String str = CodeGenerator.generate(new CodeObject[] { this.defaultCodeObject });
		return str.concat(getPushScript());
	}

	public String getDateFormat() {
		return this.dateFormat;
	}

	public void setDateFormat(String paramString) {
		this.dateFormat = paramString;
	}

	public String getTimeFormat() {
		return this.timeFormat;
	}

	public void setTimeFormat(String paramString) {
		this.timeFormat = paramString;
	}

	public String getDateWidth() {
		return this.dateWidth;
	}

	public void setDateWidth(String paramInt) {
		this.dateWidth = paramInt;
	}

	public String getTimeWidth() {
		return this.timeWidth;
	}

	public void setTimeWidth(String paramInt) {
		this.timeWidth = paramInt;
	}

	public ExtDateTimeField(String paramString) {
		super(paramString);
	}

	public String getDateConfig() {
		return this.dateConfig;
	}

	public void setDateConfig(String paramString) {
		this.dateConfig = paramString;
	}

	public String getTimeConfig() {
		return this.timeConfig;
	}

	public void setTimeConfig(String paramString) {
		this.timeConfig = paramString;
	}
}